package com.fresh.liangyi.service.impl;

import com.fresh.liangyi.dao.OrderMapper;
import com.fresh.liangyi.model.domain.Address;
import com.fresh.liangyi.model.domain.Goods;
import com.fresh.liangyi.model.domain.Order;
import com.fresh.liangyi.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class OrderServiceImpl implements OrderService {
    @Autowired
    private OrderMapper orderMapper;
    @Override
    public Integer orderDetailsAdd(Integer gId, Integer aId) {
        return orderMapper.orderDetailsAdd(gId,aId);
    }

    @Override
    public Integer orderAdd(Order order) {
        return orderMapper.orderAdd(order);
    }

    @Override
    public List<Goods> showGoodsByOrderId(Integer orderId) {
        return orderMapper.showGoodsByOrderId(orderId);
    }

    @Override
    public List<Order> showOrderByUserId(Integer userId) {
        return orderMapper.showOrderByUserId(userId);
    }

    @Override
    public Address getAddressByOrderId(Integer orderId) {
        return orderMapper.getAddressByOrderId(orderId);
    }

    @Override
    public Order selectOrderById(Integer orderId) {
        return orderMapper.selectOrderById(orderId);
    }

    @Override
    public List<Order> showOrder() {
        return orderMapper.showOrder();
    }

    @Override
    public Integer updateOrder(Order order) {
        return orderMapper.updateOrder(order);
    }

}
